!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div><button id="ceshi">测试</button></div>

</body>
<script type="text/javascript" src="js/jquery-3.4.1.min.js
"></script>
<script>
    $("#ceshi").click(function () {
        console.log("ceshi");
        $.ajax({
            async: true,   //同步异步
            type: 'POST',  //post get
            url: 'toIndexMusic', //发送请求的地址
            contentType: 'application/json',
            data:{},
            dataType : "json",
            success: function () {
                // console.log(msg);
            }

        });
    });

</script>
</html>